<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 300px;
            height: 300px;
        }

        @media screen and (max-width:768px) {
            .box{
                background-color: blue;

            }
            .p1{
                display: none;
            }
            .p2{
                display: none;
            }
        }
        @media screen and (min-width:768px) and (max-width:996px) {
            .box{
                background-color: green;
            }
            .p1{
                display: none;
            }
            .p2{
                display: block;
            }
        }
        @media screen and (min-width:996px) {
            .box{
                background-color: red;
            }
            .p1{
                display: block;
            }
            .p2{
                display: block;
            }
        }
    </style>
</head>
<body>
    <div class="box"></div>
    <p class="p1">hahaha</p>
    <p class="p2">heheheheheh</p>
</body>
</html>